<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- 
 * psml2html.xsl
 *
 * This XSLT will convert a PSML file, saved by Wireshark, into
 *    HTML. The HTML page should look like packet explorer of Wireshark . - prototype
 *
 *
 * LICENSE: 
 * This file is part of EasyShark.
 *
 *   EasyShark is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   Easypcap is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @author     Balazs Barcsik <balazs.barcsik@gmail.com>
 * @license    http://www.gnu.org/licenses/gpl.txt 
 * @version    2013-08-24 
 -->
<xsl:output method="html" encoding="UTF-8" omit-xml-declaration="no" standalone="yes" indent="yes"/>

<xsl:param name="window"/>

<xsl:template  match="section">

 <td><xsl:value-of select="."/></td>
</xsl:template>


<xsl:template  match="packet">

<xsl:variable name="frame_num" select="section[1]"/> <!-- select frame number-->
 <xsl:variable name="frame_id"  select="concat($window,$frame_num)"/>
 <xsl:variable name="frame_c"   select="concat($frame_id,'c')"/>
<tr id="tr_{$frame_id}" style="background-color:#efefe1;" onClick="showFrame('{$window}','{$frame_id}', '{$frame_c}','span_octet_{$frame_c}')">
<xsl:apply-templates/>
</tr>
</xsl:template>

<xsl:template match="/">
<div width="100%" style="height: 400px; overflow-y: scroll; overflow-x: scroll;">
<table width="1200px">
<xsl:apply-templates/>
</table> 
</div>
</xsl:template>
</xsl:stylesheet>
